<?php

require_once "WxPay.Config.Interface.php";

class WxPayConfig extends WxPayConfigInterface
{
    private $app_id;
    private $mch_id;
    private $key;
    private $secret;
    private $notify_url;

    public function SetAppId($app_id)
    {
        $this->app_id = $app_id;
    }
    public function SetMerchantId($mch_id)
    {
        $this->mch_id = $mch_id;
    }
    public function SetNotifyUrl($notify_url)
    {
        $this->notify_url = $notify_url;
    }
    public function SetKey($key)
    {
        $this->key = $key;
    }
    public function SetAppSecret($secret)
    {
        $this->secret = $secret;
    }
    /**
     * 微信AppId
     * @return string
     */
    public function GetAppId()
    {
        return $this->app_id;
    }

    /**
     * 商户mch_id
     * @return string
     */
    public function GetMerchantId()
    {
        return $this->mch_id;
    }

    /**
     * 支付回调url
     * @return string
     */
    public function GetNotifyUrl()
    {
        return $this->notify_url;
    }

    /**
     * 签名类型
     * @return string
     */
    public function GetSignType()
    {
        return "HMAC-SHA256";
    }

    /**
     * 设置代理机器
     * @param $proxyHost
     * @param $proxyPort
     */
    public function GetProxy(&$proxyHost, &$proxyPort)
    {
        $proxyHost = "0.0.0.0";
        $proxyPort = 0;
    }

    /**
     * 接口调用上报等级，默认紧错误上报
     * @return int
     */
    public function GetReportLevenl()
    {
        return 1;
    }

    /**
     * 商户支付密钥
     * @return string
     */
    public function GetKey()
    {
        return $this->key;
    }

    /**
     * 公众帐号secert（仅JSAPI支付的时候需要配置， 登录公众平台，进入开发者中心可设置）
     * @return string
     */
    public function GetAppSecret()
    {
        return $this->secret;
    }

    /**
     * 证书路径,注意应该填写绝对路径（仅退款、撤销订单时需要，可登录商户平台下载，
     * @param $sslCertPath
     * @param $sslKeyPath
     */
    public function GetSSLCertPath(&$sslCertPath, &$sslKeyPath)
    {
        $sslCertPath = '../cert/apiclient_cert.pem';
        $sslKeyPath = '../cert/apiclient_key.pem';
    }
}
